package com.tdkj.model.shop;

import java.sql.Timestamp;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import com.tdkj.model.base.BaseEntity;
import com.tdkj.model.user.BeanUser;

/**
 * GoodsComments entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "shop_good_comment")
public class BeanGoodComment extends BaseEntity {

	private String title;
	private String content;
	
	private BeanOrderItem orderItem;
	private BeanUser user;
	private BeanGood good;
	
	private BeanGoodCommentLevel level;
	private List<BeanGoodCommentReply> replys;
	
	private Timestamp createTime;
	

	public String getTitle() {
		return this.title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getContent() {
		return this.content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	/**
	 * @return the orderContent
	 */
	@ManyToOne(fetch=FetchType.EAGER, cascade={CascadeType.REFRESH})
	@JoinColumn(name="order_item_id")
	public BeanOrderItem getOrderItem() {
		return orderItem;
	}

	/**
	 * @param orderContent the orderContent to set
	 */
	public void setOrderItem(BeanOrderItem orderItem) {
		this.orderItem = orderItem;
	}

	/**
	 * @return the user
	 */
	@ManyToOne(fetch=FetchType.EAGER, cascade={CascadeType.REFRESH})
	@JoinColumn(name="user_id")
	public BeanUser getUser() {
		return user;
	}

	/**
	 * @param user the user to set
	 */
	public void setUser(BeanUser user) {
		this.user = user;
	}

	/**
	 * @return the good
	 */
	@ManyToOne(fetch=FetchType.EAGER, cascade={CascadeType.REFRESH})
	@JoinColumn(name="good_id")
	public BeanGood getGood() {
		return good;
	}

	/**
	 * @param good the good to set
	 */
	public void setGood(BeanGood good) {
		this.good = good;
	}

	/**
	 * @return the level
	 */
	@ManyToOne(fetch=FetchType.EAGER, cascade={CascadeType.REFRESH})
	@JoinColumn(name="level_id")
	public BeanGoodCommentLevel getLevel() {
		return level;
	}

	/**
	 * @param level the level to set
	 */
	public void setLevel(BeanGoodCommentLevel level) {
		this.level = level;
	}

	/**
	 * @return the replys
	 */
	@OneToMany(fetch=FetchType.LAZY, cascade={CascadeType.REFRESH}, mappedBy="comment")
	public List<BeanGoodCommentReply> getReplys() {
		return replys;
	}

	/**
	 * @param replys the replys to set
	 */
	public void setReplys(List<BeanGoodCommentReply> replys) {
		this.replys = replys;
	}

	/**
	 * @return the createTime
	 */
	public Timestamp getCreateTime() {
		return createTime;
	}

	/**
	 * @param createTime the createTime to set
	 */
	public void setCreateTime(Timestamp createTime) {
		this.createTime = createTime;
	}

	
	
}